package nsoft.util;

import java.util.regex.Pattern;

public class InputPattern {

	public static final short TYPE_SHORT = 0;
	public static final short TYPE_INT = 1;
	public static final short TYPE_LONG = 2;
	public static final short TYPE_DOUBLE = 3;
	public static final short TYPE_BIG_DECIMAL = 4;
	public static final short TYPE_STRING = 5;
	public static final short TYPE_UNKNOWN = -1;

	private Short type = 5;
	private String pattern = null;
	private Integer length = 1024;
	private Integer decimals;
	private Integer integrals;

	public InputPattern(Short type, String pattern, Integer length,
			Integer decimals, Integer integrals) {

	}

	public Short getType() {
		return type;
	}

	public String getPattern() {
		return pattern;
	}

	public Integer getLength() {
		return length;
	}

	public Integer getDecimals() {
		return decimals;
	}

	public Integer getIntegrals() {
		return integrals;
	}

	public boolean matches(String value) {
		return Pattern.matches(pattern, value);
	}

}
